﻿<%@ Page Title="" Language="C#" MasterPageFile="~/SiteTemplate.master" AutoEventWireup="true"
    CodeFile="DefaultMain.aspx.cs" Inherits="DefaultMain" %>

<%@ Import Namespace="SiteECSWeb" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <div class="basicContent">
        <div class="PrettyBox">
            <div class="topLight">
                <h2>
                    التمثيل التجارى المصرى فى سطور</h2>
            </div>
            <div class="MainCol">
                <div class="Mainwrapper">
                    <div class="ColAddRight" style="width: 27.8em;">
                        <p>
                            يشارك التمثيل التجارى فى تنفيذ خطة الدولة فى دعم الصادرات المصرية وزيادة فرص نفاذها
                            إلى الأسواق الخارجية والعمل على جذب الاستثمارات الأجنبية داخل القطاعات الانتادجية
                            المختلفة فى الدولة ، فضلا عن دوره فى صياغة وتطوير علاقات مصر الاقتصادية الخارجية
                            سواء على المستوى الثنائى أو الاقليمى أو المتعدد الأطراف.
                            <br>                            
                            وفى سبيل تحقيق هذه الأهداف يسعى التمثيل التجارى من خلال منظومة عمل متطورة
                            تضم المكاتب التجارى المنتشرة فى دول العالم والمركز الرئيس بالقاهرة إلى تمكين قطاع
                            الأعمال المصرى وتشجيعه على التصدير والدخول فى شراكات جادة وطويلة المدى مع أصحاب
                            الأعمال والمستوردين والمستثمرين الأجانب ، تقوم على الفهم الجيد لطبيهة الأسواق الدولية
                            وظروف المنافسة بها ، وكذا المتغيرات والتطورات العالمية.
                        </p>
                    </div>
                    <div class="ColAddLeft" style="width: 19.95em;">
                        <div class="pics imgDeft" style="width: auto; height: auto;">
                            <div class="imgF">
                                <center>
                                    <table border="0" cellpadding="0" cellspacing="0" class="photo-frame">
                                        <tr>
                                            <td class="topx--">
                                            </td>
                                            <td class="top-x-">
                                            </td>
                                            <td class="top--x">
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="midx--">
                                            </td>
                                            <td>
                                            <div id="slideshow2"> 
                                                <img id="Img888" src="~/Images/IMG_0005.JPG" width="300" height="200" runat="server"
                                                    class="photo_198" alt="Photo" />
                                                    <img id="Img7" src="~/Images/IMG_0114.jpg" width="300" height="200" runat="server"
                                                    class="photo_198" alt="Photo" />
                                                    <img id="Img8" src="~/Images/IMG_0018.jpg" width="300" height="200" runat="server"
                                                    class="photo_198" alt="Photo" />
                                                    </div>
                                            </td>
                                            <td class="mid--x">
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="botx--">
                                            </td>
                                            <td class="bot-x-">
                                            </td>
                                            <td class="bot--x">
                                            </td>
                                        </tr>
                                    </table>
                                </center>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="bottonLight">
            </div>
        </div>
    </div>
     <div class="clear">
            </div>
    <div id="colright">
        <div id="shiftright">
            <h2>
                الأخبار</h2>
            <div id="slideshow1" class="pics">
                <img src="Images/news_1.png" width="130" height="156" alt="1" runat="server" />
                <img id="Img5" src="Images/news_1.png" width="130" height="156" alt="1" runat="server" />
                <img id="Img6" src="Images/news_1.png" width="130" height="156" alt="1" runat="server" />
            </div>
            <div class="listitems">
                <asp:Repeater ID="ReptNews" runat="server" DataSourceID="NewsDataSource" OnItemDataBound="ReptNews_ItemDataBound">
                    <HeaderTemplate>
                        <ul>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <li>
                            <img src="Images/common/bulletH.gif" alt="just bullet" />
                            <asp:HyperLink ID="HyperLink1" runat="server" Text='<%# Eval("News_nm") %>' NavigateUrl='<%# Helper.NavURLParamsIntVirtualName(Eval("News_id"),Globals.Settings.VirtualNamesInfo.NewsDetails) %>'
                                SkinID="basicHyperLink"></asp:HyperLink>
                            <asp:Repeater ID="rptSubNews" runat="server">
                                <ItemTemplate>
                                    <blockquote>
                                        <label>
                                            <%# ((DateTime)Eval("News_date")).ToString("dddd, d MMMM, yyyy")%>
                                        </label>
                                        <br />
                                        <span>
                                            <%# ReduceString(Eval("News_descr")) %>
                                        </span>
                                    </blockquote>
                                </ItemTemplate>
                            </asp:Repeater>
                        </li>
                    </ItemTemplate>
                    <FooterTemplate>
                        </ul>
                    </FooterTemplate>
                </asp:Repeater>
                <asp:ObjectDataSource ID="NewsDataSource" runat="server" OldValuesParameterFormatString="{0}"
                    SelectMethod="GetNewsDataWithTopFiveRankRows" TypeName="SiteECSWeb.NewsBLL"></asp:ObjectDataSource>
            </div>
            <div class="clear">
            </div>
            <div class="buttonbardefault">
                <div style="clear: right;">
                    <asp:HyperLink ID="HyperNewsLinkMore" runat="server" CssClass="button_red11_extradark">
                            <span class="left"></span><span class="middle">المزيد...</span><span class="right"></span></asp:HyperLink>
                </div>
            </div>
            <div id="rightlast">
            </div>
        </div>
        <div id="shiftleftright">
            <h2>
                الفرص التصديرية</h2>
            <div class="listitems">
                <asp:Repeater runat="server" ID="ReptExportOpp" DataSourceID="ExportOppDataSource"
                    OnItemDataBound="ReptExportOpp_ItemDataBound">
                    <HeaderTemplate>
                        <ul>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <li>
                            <img src="Images/common/bulletH.gif" alt="just bullet" />
                            <asp:HyperLink ID="HyperLink1" runat="server" Text='<%# " فرصة لـ " + Eval("Ex_oppNameAr") %>'
                                NavigateUrl='<%# SiteECSWeb.Helper.NavURLParamsIntVirtualName(Eval("Ex_oprtid"),Globals.Settings.VirtualNamesInfo.ExportOppDetails) %>'
                                SkinID="basicHyperLink"></asp:HyperLink>
                            <asp:Repeater ID="rptSubExportOpp" runat="server">
                                <ItemTemplate>
                                    <blockquote>
                                        <label>
                                            <%# ((DateTime)Eval("Ex_oprtdate")).ToString("dddd, d MMMM, yyyy")%>
                                        </label>
                                        <br />
                                        <span>
                                            <%# ReduceString(Eval("Ex_oprtspecif"))%>
                                        </span>
                                    </blockquote>
                                </ItemTemplate>
                            </asp:Repeater>
                        </li>
                    </ItemTemplate>
                    <FooterTemplate>
                        </ul>
                    </FooterTemplate>
                </asp:Repeater>
            </div>
            <asp:ObjectDataSource ID="ExportOppDataSource" runat="server" OldValuesParameterFormatString="original_{0}"
                SelectMethod="GetTopExportOppDataRank" TypeName="SiteECSWeb.ExpOppBLL"></asp:ObjectDataSource>
            <div class="buttonbardefault mrightbtn">
                <div style="clear: right;">
                    <asp:HyperLink ID="HyperExpOppLinkMore" runat="server" CssClass="button_red11_extradark"
                        NavigateUrl="~/ExprtOpp/ExprtOppList.aspx">
                            <span class="left"></span><span class="middle">المزيد...</span><span class="right"></span></asp:HyperLink>
                </div>
            </div>
            <div id="rightleftlast">
            </div>
        </div>
        <div id="shiftrightright">
            <h2>
                المناقصات الدولية</h2>
            <div class="listitems">
                <asp:Repeater runat="server" ID="ReptTenders" DataSourceID="TendersDataSource" OnItemDataBound="ReptTenders_ItemDataBound">
                    <HeaderTemplate>
                        <ul>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <li>
                            <img src="Images/common/bulletH.gif" alt="just bullet" />
                            <asp:HyperLink ID="HyperLink1" runat="server" Text='<%# Eval("Tend_name") %>' NavigateUrl='<%# SiteECSWeb.Helper.NavURLParamsIntVirtualName(Eval("Tend_id"), Globals.Settings.VirtualNamesInfo.TendersDetails) %>'
                                SkinID="basicHyperLink"></asp:HyperLink>
                            <asp:Repeater ID="rptSubTenders" runat="server">
                                <ItemTemplate>
                                    <blockquote>
                                        <label>
                                            <%# ((DateTime)Eval("Tend_stdate")).ToString("dddd, d MMMM, yyyy")%>
                                        </label>
                                        <br />
                                        <span>
                                            <%# ReduceString(Eval("Tend_descrp"))%>
                                        </span>
                                    </blockquote>
                                </ItemTemplate>
                            </asp:Repeater>
                        </li>
                    </ItemTemplate>
                    <FooterTemplate>
                        </ul>
                    </FooterTemplate>
                </asp:Repeater>
            </div>
            <asp:ObjectDataSource ID="TendersDataSource" runat="server" OldValuesParameterFormatString="original_{0}"
                SelectMethod="GetTopTendersDataRank" TypeName="SiteECSWeb.TenderBLL"></asp:ObjectDataSource>
            <div class="buttonbardefault mrightbtn">
                <div style="clear: right;">
                    <asp:HyperLink ID="HyperTenderLinkMore" runat="server" CssClass="button_red11_extradark"
                        NavigateUrl="~/Tenders/TendersList.aspx">
                            <span class="left"></span><span class="middle">المزيد...</span><span class="right"></span></asp:HyperLink>
                </div>
            </div>
            <div id="rightrightlast">
            </div>
        </div>
    </div>
    <div id="colleft">
        <div id="shiftleft">
            <h2>
                المعارض الدولية</h2>
            <div id="sliderdef">
                <div class="scroll">
                    <div class="scrollContainer">
                        <div class="section" id="1">
                            <div class="col-all">
                                <div class="imgF">
                                    <center>
                                        <table border="0" cellpadding="0" cellspacing="0" class="photo-frame">
                                            <tr>
                                                <td class="topx--">
                                                </td>
                                                <td class="top-x-">
                                                </td>
                                                <td class="top--x">
                                                </td>
                                            </tr>
                                            <tr>
                                                <td class="midx--">
                                                </td>
                                                <td>
                                                    <img src="~/Images/destacado_sabina.gif" width="150" height="45" runat="server" class="photo_198" alt="Fair Image" />
                                                </td>
                                                <td class="mid--x">
                                                </td>
                                            </tr>
                                            <tr>
                                                <td class="botx--">
                                                </td>
                                                <td class="bot-x-">
                                                </td>
                                                <td class="bot--x">
                                                </td>
                                            </tr>
                                        </table>
                                    </center>
                                </div>
                                <div id="text1">
                                </div>
                            </div>
                        </div>
                        <div class="section" id="2">
                            <div class="col-all">
                                <div class="imgF">
                                    <center>
                                        <table border="0" cellpadding="0" cellspacing="0" class="photo-frame">
                                            <tr>
                                                <td class="topx--">
                                                </td>
                                                <td class="top-x-">
                                                </td>
                                                <td class="top--x">
                                                </td>
                                            </tr>
                                            <tr>
                                                <td class="midx--">
                                                </td>
                                                <td>
                                                    <img id="Img1" src="~/Images/destacado_sanz.jpg" width="150" height="45" runat="server"
                                                        class="photo_198" />
                                                </td>
                                                <td class="mid--x">
                                                </td>
                                            </tr>
                                            <tr>
                                                <td class="botx--">
                                                </td>
                                                <td class="bot-x-">
                                                </td>
                                                <td class="bot--x">
                                                </td>
                                            </tr>
                                        </table>
                                    </center>
                                </div>
                                <div id="text2">
                                </div>
                            </div>
                        </div>
                        <div class="section" id="3">
                            <div class="col-all">
                                <div class="imgF">
                                    <center>
                                        <table border="0" cellpadding="0" cellspacing="0" class="photo-frame">
                                            <tr>
                                                <td class="topx--">
                                                </td>
                                                <td class="top-x-">
                                                </td>
                                                <td class="top--x">
                                                </td>
                                            </tr>
                                            <tr>
                                                <td class="midx--">
                                                </td>
                                                <td>
                                                    <img id="Img2" src="~/Images/destacado_sanz.jpg" width="150" height="45" runat="server"
                                                        class="photo_198" />
                                                </td>
                                                <td class="mid--x">
                                                </td>
                                            </tr>
                                            <tr>
                                                <td class="botx--">
                                                </td>
                                                <td class="bot-x-">
                                                </td>
                                                <td class="bot--x">
                                                </td>
                                            </tr>
                                        </table>
                                    </center>
                                </div>
                                <div id="text3">
                                </div>
                            </div>
                        </div>
                        <div class="section" id="4">
                            <div class="col-all">
                                <div class="imgF">
                                    <center>
                                        <table border="0" cellpadding="0" cellspacing="0" class="photo-frame">
                                            <tr>
                                                <td class="topx--">
                                                </td>
                                                <td class="top-x-">
                                                </td>
                                                <td class="top--x">
                                                </td>
                                            </tr>
                                            <tr>
                                                <td class="midx--">
                                                </td>
                                                <td>
                                                    <img id="Img3" src="~/Images/destacado_sanz.jpg" width="150" height="45" runat="server"
                                                        class="photo_198" />
                                                </td>
                                                <td class="mid--x">
                                                </td>
                                            </tr>
                                            <tr>
                                                <td class="botx--">
                                                </td>
                                                <td class="bot-x-">
                                                </td>
                                                <td class="bot--x">
                                                </td>
                                            </tr>
                                        </table>
                                    </center>
                                </div>
                                <div id="text4">
                                </div>
                            </div>
                        </div>
                        <div class="section" id="5">
                            <div class="col-all">
                                <div class="imgF">
                                    <center>
                                        <table border="0" cellpadding="0" cellspacing="0" class="photo-frame">
                                            <tr>
                                                <td class="topx--">
                                                </td>
                                                <td class="top-x-">
                                                </td>
                                                <td class="top--x">
                                                </td>
                                            </tr>
                                            <tr>
                                                <td class="midx--">
                                                </td>
                                                <td>
                                                    <img id="Img4" src="~/Images/destacado_sanz.jpg" width="150" height="45" runat="server"
                                                        class="photo_198" />
                                                </td>
                                                <td class="mid--x">
                                                </td>
                                            </tr>
                                            <tr>
                                                <td class="botx--">
                                                </td>
                                                <td class="bot-x-">
                                                </td>
                                                <td class="bot--x">
                                                </td>
                                            </tr>
                                        </table>
                                    </center>
                                </div>
                                <div id="text5">
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <ul class="navigation">
                    <li><a href="#1"></a></li>
                    <li><a href="#2"></a></li>
                    <li><a href="#3"></a></li>
                    <li><a href="#4"></a></li>
                    <li><a href="#5"></a></li>
                </ul>
            </div>
            <div class="buttonbardefault">
                <div style="clear: right;">
                    <asp:HyperLink ID="HyperLink2" runat="server" CssClass="button_red11_extradark" NavigateUrl="~/Fairs/FairsList.aspx">
                            <span class="left"></span><span class="middle">المزيد...</span><span class="right"></span></asp:HyperLink>
                </div>
            </div>
            <div id="leftlast">
            </div>
        </div>
        <div id="shiftleft2">
            <h2>
                موضوعات مؤثرة على التجارة</h2>
            <div class="listitems">
                <asp:Repeater runat="server" ID="ReptTradAffectSub" DataSourceID="TradAffectSubDataSource"
                    OnItemDataBound="ReptTradAffectSub_ItemDataBound">
                    <HeaderTemplate>
                        <ul>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <li>
                            <table>
                                <tbody>
                                    <tr>
                                        <td style="vertical-align: top;">
                                            <img src="Images/common/bulletH.gif" alt="just bullet" /></td>
                                        <td>
                                            <asp:HyperLink ID="HyperLink1" runat="server" Text='<%# Eval("TrdaffSub_NameAr") %>'
                                                NavigateUrl='<%# SiteECSWeb.Helper.NavURLParamsIntVirtualName(Eval("TrdaffSub_Id"),Globals.Settings.VirtualNamesInfo.TradAffectSubDetails) %>'
                                                SkinID="basicHyperLink"></asp:HyperLink>
                                        </td>
                                    </tr>
                                </tbody>
                            </table>
                            <asp:Repeater ID="rptSubTradAffect" runat="server">
                                <ItemTemplate>
                                    <blockquote>
                                        <label>
                                            <%# ((DateTime)Eval("TrdaffSub_Date")).ToString("dddd, d MMMM, yyyy")%>
                                        </label>
                                        <br />
                                        <span>
                                            <%# ReduceString(Eval("TrdaffSub_Desc"))%>
                                        </span>
                                    </blockquote>
                                </ItemTemplate>
                            </asp:Repeater>
                        </li>
                    </ItemTemplate>
                    <FooterTemplate>
                        </ul>
                    </FooterTemplate>
                </asp:Repeater>
                <asp:ObjectDataSource ID="TradAffectSubDataSource" runat="server" OldValuesParameterFormatString="original_{0}"
                    SelectMethod="GetTradAffectSubRowRank" TypeName="SiteECSWeb.TradAffectSubBLL"></asp:ObjectDataSource>
            </div>
            <div class="buttonbardefault mrightbtn">
                <div style="clear: right;">
                    <asp:HyperLink ID="HyperLink3" runat="server" CssClass="button_red11_extradark" NavigateUrl="~/TradAffectSub/TradAffectSubList.aspx">
                            <span class="left"></span><span class="middle">المزيد...</span><span class="right"></span></asp:HyperLink>
                </div>
            </div>
            <div id="leftlast2">
            </div>
        </div>
    </div>
    <script type="text/javascript">
    
function pageLoad()
{
 Item(1);
}
 

function Item(pageindex)
{
    jQuery.ajax({
        type: "POST",
        url: "DefaultMain.aspx/GetFarisItems",
        data: "{'pageindex':'"+pageindex +"', 'pagesize':'1'}",        
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: function(response) {
            //response = dateFix(response);
            itemCallback(pageindex,response);
        }
    }); 
}
function itemCallback(pageindex,response)
{
    //alert(response[0].Name);
    //jQuery('.box .header .titlescroll h3#nameMe').empty();
    
    
    jQuery('#sliderdef .scrollContainer #'+pageindex+' .col-all #text'+pageindex+'').empty();
    
    jQuery('#sliderdef .scrollContainer #'+pageindex+' .col-all .photo-frame tbody tr td > img')
    .attr('src',''+response[0].ImgPath+'');    
    ///for path only
    //<%# Helper.NavURLParamsIntVirtualName(Eval("Fair_id"),Globals.Settings.VirtualNamesInfo.FairsDetails) %>
    //<%= Helper.NavURLParamsIntVirtualName(MyEval("'+ss+'"),Globals.Settings.VirtualNamesInfo.FairsDetails) %>
    var NavUrlDetails = response[0].NavUrlDetails;    
    if(NavUrlDetails.indexOf('~') == 0){
        NavUrlDetails =NavUrlDetails.substring(2);    
    }
    var baseNavUrlDetails = '<%= Page.ResolveUrl("'+NavUrlDetails+'") %>';
    
    var NavUrlCountry = response[0].NavUrlCountryList;    
    if(NavUrlCountry.indexOf('~') == 0){
        NavUrlCountry =NavUrlCountry.substring(2);    
    }
    var baseNavUrlCountry = '<%= Page.ResolveUrl("'+NavUrlCountry+'") %>';
    ////end of the path
    
    ///for website
    var webURl = response[0].WebSite;
    if(webURl.indexOf('http://') != 0){
        webURl = 'http://' + response[0].WebSite;
    }
    ///end of website
    
    var itemMemo ='<div class="bgF">';  
    itemMemo+='<div class="memoF headF"><center><a href="'+baseNavUrlDetails+'">'+ response[0].Name+'</a></center></div>';
    itemMemo+='<div class="memoF">يعقد فى: <a href="'+response[0].NavUrlCountryList+'" class="Linkitems">'+ response[0].CountryName+'</a></div>';
    itemMemo+='<div class="memoF">الفترة من: '+ response[0].DateFormat+'</div>';
    itemMemo+='<div class="memoF"><table><tbody><tr><td>الجهة المنظمة:</td><td>'+ response[0].AuthorityName+'</td></tr></tbody></table></div>';
    itemMemo+='<div class="memoF">للتسجيل فى المعرض: <a href="'+ webURl+'" class="Linkitems" target="_blank">'+ response[0].WebSite+'</a></div>';
    itemMemo+='<br></div>';    
    
    
    //jQuery('.box .header .titlescroll h3#nameMe').append(response[0].Name);
    jQuery('#sliderdef .scrollContainer #'+pageindex+' .col-all #text'+pageindex+'').append(itemMemo);
   
}

// when the DOM is ready...
jQuery(document).ready(function () {

var $panels = jQuery('#sliderdef .scrollContainer > div');
var $container = jQuery('#sliderdef .scrollContainer');
var horizontal = true;

// float the panels left if we're going horizontal
if (horizontal) {
  $panels.css({
    'float' : 'left',
    'position' : 'relative' // IE fix to ensure overflow is hidden
  });
  $container.css('width', $panels[0].offsetWidth * $panels.length);
}

var $scroll = jQuery('#sliderdef .scroll').css('overflow', 'hidden');
  $scroll
  .before('<div id="slideDefNext"><a class="sliderArrowNext" ></a></div>')
  .after('<div id="slideDefPrev"><a class="sliderArrowPrev" ></a></div>');

// handle nav selection
function selectNav() {
  jQuery(this)
    .parents('ul:first')
      .find('a')
        .removeClass('selected')
      .end()
    .end()
    .addClass('selected');
}

jQuery('#sliderdef .navigation').find('a').click(selectNav);


// go find the navigation link that has this target and select the nav
function trigger(data) {
//    var dd = data.id;
//    alert(dd);
  Item(data.id);
  var el = jQuery('#sliderdef .navigation').find('a[href$="' + data.id + '"]').get(0);  
  selectNav.call(el);
}


if (window.location.hash) {
  trigger({ id : window.location.hash.substr(1) });
} else {
  jQuery('ul.navigation a:first').click();
}

var offset = parseInt((horizontal ? 
  $container.css('paddingTop') : 
  $container.css('paddingLeft')) 
  || 0) * -1;


var scrollOptions = {
  target: $scroll, // the element that has the overflow
  items: $panels,
  navigation: '.navigation a',  
  prev: '#slideDefPrev', 
  next: '#slideDefNext',  
  axis: 'xy',  
  //stop:true,
  onAfter: trigger, // our final callback
  offset: offset,  
  duration: 500,  
  //interval:1,  
  easing: 'swing'  
};

jQuery('#sliderdef').serialScroll(scrollOptions);
jQuery.localScroll(scrollOptions);
scrollOptions.duration = 1;
scrollOptions.lazy = true;
jQuery.localScroll.hash(scrollOptions);


jQuery('#slideshow1').cycle('slideX');
jQuery('#slideshow2').cycle('fade');


});
    </script>
</asp:Content>
